//package com.ai.bitcoin.queue;
//
//import com.ai.bitcoin.exception.ThreadShutDownException;
//import com.ai.bitcoin.service.helper.NsqServiceHelper;
//import com.ai.bitcoin.util.JacksonUtils;
//import com.ai.bitcoin.vo.Price2BccVo;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import java.util.concurrent.Callable;
//
//public class PriceThread implements Callable<Void> {
//
//    private static Logger logger = LoggerFactory
//            .getLogger(NewsThread.class);
//
//    private MessageQueue priceQueue;
//
//    private NsqServiceHelper nsqServiceHelper;
//
//    public PriceThread(MessageQueue priceQueue,NsqServiceHelper nsqServiceHelper) {
//        super();
//        this.priceQueue = priceQueue;
//        this.nsqServiceHelper = nsqServiceHelper;
//    }
//
//    @Override
//    public Void call() throws Exception {
//        logger.warn("Price Thread starting ...");
//        while (true) {
//            try {
//                String data = this.priceQueue.receive();
//                Price2BccVo price2BccVo = JacksonUtils.fromJson(data, Price2BccVo.class);
//                nsqServiceHelper.distributorPriceCHange(price2BccVo);
//            } catch (ThreadShutDownException e) {
//                if(logger.isDebugEnabled()) {
//                    logger.debug("message thread shutdown");
//                }
//                break;
//            } catch (Exception e1) {
//                logger.error(e1.getMessage(), e1);
//            }
//        }
//        return null;
//    }
//}